/*    */ package com.asiainfo.dacp.catalog.controller;
/*    */ 
/*    */ import com.asiainfo.dacp.stat.olapcheck.OlapCheckService;
/*    */ import com.asiainfo.dacp.stat.olapcheck.OlapInfo;
/*    */ import java.io.Writer;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.stereotype.Controller;
/*    */ import org.springframework.web.bind.annotation.RequestMapping;
/*    */ 
/*    */ 
/*    */ @Controller
/*    */ public class OlapCheckController
/*    */ {
/*    */   @Autowired
/*    */   private OlapCheckService olapService;
/*    */   
/*    */   @RequestMapping({"/olapcheck"})
/*    */   public void olapCheck(HttpServletRequest request, HttpServletResponse response)
/*    */     throws Exception
/*    */   {
/* 23 */     String olapcode = request.getParameter("olapcode");
/* 24 */     String optime = request.getParameter("optime");
/* 25 */     String comparetime = request.getParameter("comparetime");
/* 26 */     String where = request.getParameter("where");
/* 27 */     Writer out = response.getWriter();
/* 28 */     if (!this.olapService.prepareOlapData(olapcode, optime, comparetime)) {
/* 29 */       OlapInfo olapInfo = new OlapInfo(olapcode);
/* 30 */       olapInfo.loadOlapData(optime, comparetime, where);
/* 31 */       out.append("finish");
/*    */     } else {
/* 33 */       out.append("finished");
/*    */     }
/* 35 */     out.flush();
/* 36 */     out.close();
/*    */   }
/*    */   
/*    */   @RequestMapping({"/olapquery"})
/*    */   public void olapQuery(HttpServletRequest request, HttpServletResponse response) throws Exception {
/* 41 */     String jsonFromWeb = request.getParameter("json");
/* 42 */     String jsonToWeb = this.olapService.olapQuery(jsonFromWeb);
/* 43 */     Writer out = response.getWriter();
/* 44 */     out.append(jsonToWeb);
/* 45 */     out.flush();
/* 46 */     out.close();
/*    */   }
/*    */ }


/* Location:              C:\Users\my\.m2\repository\com\asiainfo\dacp\dacp-dataos\1.0.0\dacp-dataos-1.0.0.jar!\com\asiainfo\dacp\catalog\controller\OlapCheckController.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */